package top.drinyeit.weilong.fragment;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import java.util.HashMap;
import java.util.Map;

import top.drinyeit.weilong.R;
import top.drinyeit.weilong.base.LazyFragment;
import top.drinyeit.weilong.presenter.StoreNewPresenter;

/**
 * Created by wu on 2018/1/10.
 */

public class StoreNewFragment extends LazyFragment {
    public RecyclerView mRecyclerView;
    private int storeId;
    private StoreNewPresenter storeNewPresenter;
    private LinearLayout top;

    @Override
    protected int attachLayoutRes() {
        return  R.layout.fragment_store_new;
    }

    @Override
    protected void initViews() {
        initIntent();
        mRecyclerView = mRootView.findViewById(R.id.mRecyclerView);
        top = mRootView.findViewById(R.id.ll_top);
        top.setVisibility(View.GONE);
        initListener();
    }

    @Override
    protected void lazyLoad() {
        storeNewPresenter = new StoreNewPresenter(this);
        Map<String,Object> map = new HashMap<>();
        map.put("action","commodity_store_all");
        map.put("store_id",storeId);
        map.put("type",2);
        storeNewPresenter.getStoreAll(map);;
    }

    private void initIntent(){
        Bundle bundle = getActivity().getIntent().getExtras();
        storeId = bundle.getInt("store_id");
    }

    private void initListener(){

    }

}
